import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { UiserviceProvider } from '../../providers/uiservice/uiservice';

/**
 * Generated class for the ServerSettingPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-server-setting',
  templateUrl: 'server-setting.html',
})
export class ServerSettingPage {
  address:string;
  constructor(public navCtrl: NavController, public navParams: NavParams,public uiservice:UiserviceProvider) {
    this.address = localStorage.getItem("address");
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad ServerSettingPage');
  }
  savesetting(){
    if(this.address == null || this.address == ''){
      alert("Server Address is Empty!");
      return;
    }
    localStorage.setItem("address",this.address);
    this.uiservice.showToast("Save Successfully！");
    this.navCtrl.pop();
    
  }

}
